package de.suur.jarmi.common;

import java.io.Serializable;

/**
 * @author Martin Nonnenmacher
 */
public class Response implements Serializable {

	private static final long serialVersionUID = 1L;

	private JarmiException exception;
	private Serializable result;
	private boolean success;

	public Response() {
	}

	public Response(Exception exception) {
		this.result = null;
		this.exception = new JarmiException(exception);
		this.success = false;
	}

	public Response(Serializable result) {
		this.result = result;
		this.exception = null;
		this.success = true;
	}

	public JarmiException getException() {
		return exception;
	}

	public Serializable getResult() {
		return result;
	}

	public boolean isSuccess() {
		return success;
	}

}
